import React from 'react';
import { Watermark as AntdWatermark } from 'antd';
import type { WatermarkProps as AntdWatermarkProps } from 'antd';
import { createStyles } from 'antd-style';

export interface WatermarkProps extends AntdWatermarkProps {
  /**
   * @description 自定义样式类名
   */
  customClassName?: string;
}

const useStyles = createStyles(({ token, css }) => ({
  watermark: css`
    position: relative;
  `,
}));

const Watermark: React.FC<WatermarkProps> = ({ customClassName, className, ...restProps }) => {
  const { styles, cx } = useStyles();
  
  const watermarkClassName = cx(
    className,
    customClassName,
    styles.watermark
  );

  return <AntdWatermark className={watermarkClassName} {...restProps} />;
};

export { Watermark };
export default Watermark;

